package cbfg.http.demo.gank

import cbfg.http.annotation.GET
import cbfg.http.annotation.HostTag
import cbfg.http.annotation.Path
import cbfg.http.demo.gank.entity.BaseGankEntity
import cbfg.http.demo.gank.entity.BaseGankList
import cbfg.http.demo.gank.entity.GankItem
import cbfg.http.demo.gank.entity.SubCategory
import cbfg.http.subscribe.Observable

/**
 * @author:  Tom Hawk
 * 添加时间: 2020/9/17 14:20
 * 功能描述:
 */
@HostTag(GankService.TAG)
interface GankService {
    companion object {
        const val TAG = "gank"
        const val URL = "https://gank.io"
    }

    @GET("/api/v2/categories/{category}")
    fun getSubCategories(@Path("category") parent: String): Observable<BaseGankEntity<List<SubCategory>>>

    @GET("/api/v2/data/category/{category}/type/{type}/page/{page}/count/{count}")
    fun getContentList(
        @Path("category") category: String,
        @Path("type") type: String,
        @Path("page") page: String,
        @Path("count") count: String
    ): Observable<BaseGankList<GankItem>>

    @GET("/api/v2/data/category/{category}/type/{type}/page/{page}/count/{count}")
    fun getContentList2(
        @Path("category") category: String,
        @Path("type") type: String,
        @Path("page") page: String,
        @Path("count") count: String
    ): Observable<String>
}